package net.wangds.auth.module.impls.defaults;


import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import net.wangds.auth.module.*;
import net.wangds.data.impl.IdCreate;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;

@NoArgsConstructor
@MappedSuperclass
public class DefaultUser extends IdCreate implements User {
    private static final long serialVersionUID = 0;
    @Getter
    @Setter
    @Column(length=100)
    private String lastname;

    @Getter
    @Setter
    @Column(length=100)
    private String name;

    @Getter
    @Setter
    @Column(length=200)
    private String userName;

    @Getter
    @Setter
    @Column(length=20)
    private IdCardTypeEnum idCardType;

    @Getter
    @Setter
    @Transient
    private String idCardTypeName;


    @Getter
    @Setter
    @Column(length=20)
    private String idCardNo;


    @Getter
    @Setter
    @Column(length=4)
    private int gender;

    @Getter
    @Setter
    @Transient
    private String genderLabel;

    @Getter
    @Setter
    @Column()
    private long birthdayTm;

    @Getter
    @Setter
    @Transient
    private String birthDay;

    @Getter
    @Setter
    @Column(length=20)
    private String phone;

    @Getter
    @Setter
    @Column
    private UserOwnerEnum userOwner = UserOwnerEnum.INNER;


    /**
     * 角色.
     */
    @Getter
    @Setter
    @Transient
    private List<Role> roles = new ArrayList<>();

    /**
     * 职位.
     */
    @Getter
    @Setter
    @Transient
    private List<Job> jobs = new ArrayList<>();

    /**
     * 权限.
     */
    @Getter
    @Setter
    @Transient
    private List<Grant> privileges = new ArrayList<>();


}
